<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Login</title>
  <link rel="stylesheet" href="/common/css/bootstrap.min.css">
  <link rel="stylesheet" href="/common/css/solid.css">
</head>
<body>
<div class="container">
  <div class="page-header">
    <h1>Login</h1>
  </div>

  {{> shared/error}}

  <div class="row">
    <div class="col-md-6">
      {{#if enablePassword}}
        {{> auth/login-username-password}}
      {{/if}}
      <div class="visible-md visible-lg">
        {{> shared/create-account }}
      </div>
    </div>

    <div class="col-md-6">
      {{#if enableTls}}
        {{> auth/login-tls}}
      {{/if}}
      <div class="visible-xs visible-sm">
        {{> shared/create-account }}
      </div>
    </div>
  </div>
</div>


<script>
  // Send return URL from localStorage to server through hidden redirect_uri field
  var returnToUrl = localStorage.getItem('returnToUrl')
  if (returnToUrl) {
    for (let redirect of document.getElementsByName('redirect_uri')) {
      redirect.value = returnToUrl
    }
  }
  localStorage.removeItem('returnToUrl')
</script>
</body>
</html>
